//
//	ZcoModelDevice.m
//	Model file generated using JSONExport: https://github.com/Ahmed-Ali/JSONExport



#import "ZcoModelDevice.h"

NSString *const kZcoModelDeviceModel = @"model";
NSString *const kZcoModelDeviceType = @"type";
NSString *const kZcoModelDeviceVendor = @"vendor";

@interface ZcoModelDevice ()
@end
@implementation ZcoModelDevice




/**
 * Instantiate the instance using the passed dictionary values to set the properties values
 */

-(instancetype)initWithDictionary:(NSDictionary *)dictionary
{
	self = [super init];
	if(![dictionary[kZcoModelDeviceModel] isKindOfClass:[NSNull class]]){
		self.model = dictionary[kZcoModelDeviceModel];
	}	
	if(![dictionary[kZcoModelDeviceType] isKindOfClass:[NSNull class]]){
		self.type = dictionary[kZcoModelDeviceType];
	}	
	if(![dictionary[kZcoModelDeviceVendor] isKindOfClass:[NSNull class]]){
		self.vendor = dictionary[kZcoModelDeviceVendor];
	}	
	return self;
}


/**
 * Returns all the available property values in the form of NSDictionary object where the key is the approperiate json key and the value is the value of the corresponding property
 */
-(NSDictionary *)toDictionary
{
	NSMutableDictionary * dictionary = [NSMutableDictionary dictionary];
	if(self.model != nil){
		dictionary[kZcoModelDeviceModel] = self.model;
	}
	if(self.type != nil){
		dictionary[kZcoModelDeviceType] = self.type;
	}
	if(self.vendor != nil){
		dictionary[kZcoModelDeviceVendor] = self.vendor;
	}
	return dictionary;

}

/**
 * Implementation of NSCoding encoding method
 */
/**
 * Returns all the available property values in the form of NSDictionary object where the key is the approperiate json key and the value is the value of the corresponding property
 */
- (void)encodeWithCoder:(NSCoder *)aCoder
{
	if(self.model != nil){
		[aCoder encodeObject:self.model forKey:kZcoModelDeviceModel];
	}
	if(self.type != nil){
		[aCoder encodeObject:self.type forKey:kZcoModelDeviceType];
	}
	if(self.vendor != nil){
		[aCoder encodeObject:self.vendor forKey:kZcoModelDeviceVendor];
	}

}

/**
 * Implementation of NSCoding initWithCoder: method
 */
- (instancetype)initWithCoder:(NSCoder *)aDecoder
{
	self = [super init];
	self.model = [aDecoder decodeObjectForKey:kZcoModelDeviceModel];
	self.type = [aDecoder decodeObjectForKey:kZcoModelDeviceType];
	self.vendor = [aDecoder decodeObjectForKey:kZcoModelDeviceVendor];
	return self;

}

/**
 * Implementation of NSCopying copyWithZone: method
 */
- (instancetype)copyWithZone:(NSZone *)zone
{
	ZcoModelDevice *copy = [ZcoModelDevice new];

	copy.model = [self.model copy];
	copy.type = [self.type copy];
	copy.vendor = [self.vendor copy];

	return copy;
}
@end